SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].gspSiteEventType_SEARCH
(
@siteEventTypeId int = null,
@code int = null,
@name nvarchar(100) = null
)
AS

SELECT
  *
FROM
  [dbo].[SiteEventType]
WHERE
  (@siteEventTypeId IS NULL OR [SiteEventTypeId] = @siteEventTypeId)
AND
  (@code IS NULL OR [Code] = @code)
AND
  (@name IS NULL OR @name = '' OR [Name] LIKE @name + '%')

GO
